import 'package:base/base_lib.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import '../res/lang.dart';

class MoreLogic extends GetxController {
  final userName = "--".obs;
  final userAvatar = "".obs;
  final version = "".obs;

  @override
  onInit() {
    super.onInit();
    PackageInfo.fromPlatform().then((value) => version.value = value.version);
  }

  showLogout(BuildContext context) {
    showModalBottomSheet(
        context: context,
        backgroundColor: KColors.c_000000_opacity8p,
        builder: (context) {
          return buildBottomSheetWidget(context);
        });
  }

  Widget buildBottomSheetWidget(BuildContext context) {
    //弹框中内容  310 的调试
    return Column(
      mainAxisSize: MainAxisSize.min,
      mainAxisAlignment: MainAxisAlignment.end,
      children: [
        Button(
                color: KColors.c_FFFFFF,
                radius: 10.r,
                text: MoreStrRes.logout,
                textStyle: 14.sp.toTextStyle(
                    color: KColors.c_FFC563, fontWeight: FontWeight.bold),
                onTap: () {})
            .paddingOnly(left: 12.w, right: 12.w),
        8.height,
        Button(
            text: MoreStrRes.cancel,
            color: KColors.c_FFFFFF,
            radius: 10.r,
            textStyle: 14.sp.toTextStyle(
                color: KColors.c_1B72EC, fontWeight: FontWeight.bold),
            onTap: () {
              Navigator.of(context).pop();
            }).paddingOnly(left: 12.w, right: 12.w),
        10.height
      ],
    );
  }
}
